import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
export const getOptions = (isBackLog)=>{
    let array=[
        { label: getLabel(82, "新建"), value: 'create' },
        { label: getLabel(93, "编辑"), value: 'edit' },
        { label: getLabel(367, "查看"), value: 'view' },
        { label: getLabel(25465, "批量修改"), value: 'munedit' },
    ]
    if (isBackLog) {
        array.push({ label: getLabel(91, "删除"), value: 'delete' });
        array.push({ label: getLabel('16211','恢复') , value: 'recover' });
    }
    return array;
}
export const condition = (isBackLog) => {
    return [
        {
            "title": getLabel(20331, "查询条件"),
            "items": [
                {
                    "browserConditionParam": {
                        "completeParams": {},
                        "conditionDataParams": {},
                        "dataParams": {},
                        "destDataParams": {},
                        "hasAddBtn": false,
                        "hasAdvanceSerach": true,
                        "hasBorder": false,
                        "idSeparator": ",",
                        "isAutoComplete": 1,
                        "isDetail": 0,
                        "isMultCheckbox": false,
                        "isSingle": true,
                        "linkUrl": "/hrm/resource/HrmResource.jsp?id=",
                        "pageSize": 10,
                        "quickSearchName": "",
                        "replaceDatas": [],
                        "title": getLabel(1867, "人员"),
                        "type": "1",
                        "viewAttr": 2
                    },
                    "colSpan": 2,
                    "conditionType": "BROWSER",
                    "domkey": [
                        "operatorid"
                    ],
                    "fieldcol": 18,
                    "isQuickSearch": false,
                    "label": getLabel(99, "操作者"),
                    "labelcol": 6,
                    "precision": 0,
                    "viewAttr": 2
                }, {
                    "colSpan": 2,
                    "conditionType": "INPUT",
                    "domkey": [
                        "handletype"
                    ],
                    "fieldcol": 18,
                    "isQuickSearch": false,
                    "label": getLabel(15503, "操作类型"),
                    "labelcol": 6,
                    "precision": 0,
                    "viewAttr": 2,
                    "options":getOptions(isBackLog)
                }, {
                    "colSpan": 2,
                    "conditionType": "DATE",
                    "domkey": [
                        "createdateselect",
                        "createdatefrom",
                        "createdateto"
                    ],
                    "fieldcol": 18,
                    "isQuickSearch": false,
                    "label": getLabel(21663, "操作日期"),
                    "labelcol": 6,
                    "precision": 0,
                    "viewAttr": 2,
                    "options": [
                        { key: '0', selected: true, showname: getLabel(332, "全部") },
                        { key: '1', selected: false, showname: getLabel(15537, "今天") },
                        { key: '2', selected: false, showname: getLabel(15539, "本周") },
                        { key: '3', selected: false, showname: getLabel(15541, "本月") },
                        { key: '4', selected: false, showname: getLabel(21904, "本季") },
                        { key: '5', selected: false, showname: getLabel(15384, "本年") },
                        { key: '6', selected: false, showname: getLabel(32530, "指定日期范围") }
                    ]
                }
            ],
            "defaultshow": true
        }
    ];
}

export const detailCondition = () => {
    return [
        {
            "title": getLabel(20331, "查询条件"),
            "items": [
                {
                    "browserConditionParam": {
                        "completeParams": {},
                        "conditionDataParams": {},
                        "dataParams": {},
                        "destDataParams": {},
                        "hasAddBtn": false,
                        "hasAdvanceSerach": true,
                        "hasBorder": false,
                        "idSeparator": ",",
                        "isAutoComplete": 1,
                        "isDetail": 0,
                        "isMultCheckbox": false,
                        "isSingle": true,
                        "linkUrl": "/hrm/resource/HrmResource.jsp?id=",
                        "pageSize": 10,
                        "quickSearchName": "",
                        "replaceDatas": [],
                        "title": getLabel(1867, "人员"),
                        "type": "1",
                        "viewAttr": 2
                    },
                    "colSpan": 2,
                    "conditionType": "BROWSER",
                    "domkey": [
                        "userid"
                    ],
                    "fieldcol": 14,
                    "isQuickSearch": false,
                    "label": getLabel(99, "操作者"),
                    "labelcol": 8,
                    "precision": 0,
                    "viewAttr": 2,
                    "rowColSpan": 8
                }, {
                    "colSpan": 2,
                    "conditionType": "DATE",
                    "domkey": [
                        "createdateselect",
                        "datefrom",
                        "dateto"
                    ],
                    "fieldcol": 17,
                    "isQuickSearch": false,
                    "label": getLabel(97, "日期"),
                    "labelcol": 5,
                    "precision": 0,
                    "viewAttr": 2,
                    "rowColSpan": 16,
                    "options": [
                        { key: '0', selected: true, showname: getLabel(332, "全部") },
                        { key: '1', selected: false, showname: getLabel(15537, "今天") },
                        { key: '2', selected: false, showname: getLabel(15539, "本周") },
                        { key: '3', selected: false, showname: getLabel(15541, "本月") },
                        { key: '4', selected: false, showname: getLabel(21904, "本季") },
                        { key: '5', selected: false, showname: getLabel(15384, "本年") },
                        { key: '6', selected: false, showname: getLabel(32530, "指定日期范围") }
                    ]
                }
            ],
            "defaultshow": true
        }
    ];
}